import {
  FormItemProps,
  FormItemGiProps,
  AutoCompleteProps,
  CascaderProps,
  ColorPickerProps,
  DatePickerProps,
  DynamicInputProps,
  DynamicTagsProps,
  InputProps,
  InputNumberProps,
  MentionProps,
  RateProps,
  SelectProps,
  SliderProps,
  TimePickerProps,
  TreeSelectProps,
  UploadProps,
} from 'naive-ui'
import {StnListInputProps} from '../StnListInput'
import {StnRadioBtnGroupProps} from '../StnRadioBtnGroup'
import {StnSwitchProps} from '../StnSwitch'

/**
 * 输入组件 Props 类型
 */
export type IptPropsType =
  Partial<
    AutoCompleteProps | CascaderProps | ColorPickerProps | DatePickerProps | DynamicInputProps | DynamicTagsProps |
    InputProps | InputNumberProps | MentionProps | RateProps | SelectProps | SliderProps | TimePickerProps |
    TreeSelectProps | UploadProps | StnListInputProps | StnRadioBtnGroupProps | StnSwitchProps
  > &
  {
    options?: Array<Record<string, any>>
    getOptions?: (() => Array<Record<string, any>>)
  }

/**
 * 表单项组件 Props 类型
 */
export type FormItemPropsType = Partial<FormItemProps | FormItemGiProps>

/**
 * StnIpt 组件参数对象 props 字段类型
 */
export type StnIptPropsFieldType = {
  ipt: IptPropsType,
  formItem: FormItemPropsType,
}

/**
 * StnIpt 组件参数对象 predefineProps 字段类型
 */
export type StnIptPredefinePropsFieldType =
  StnIptPropsFieldType |
  string |
  (() => StnIptPropsFieldType)
